Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

368
Vistas
json-server "Access to localhost was denied" in Chrome

I just started using json-server and created a script, 'npm run server' to build it. However, when I try to access the JSON in my browser, I get "Access to localhost was denied".

Here's the script:

json-server --watch db.json --port 5000

enter image description here

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

I had the same issue with port 5000. I think it might be due to the port already being used by something else (if you're on a Mac, I believe it started with Monterey). I changed it to another port and it worked.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Same, I just changed the port flag in the json script to 3000, re-ran the server and all good.

 "scripts": {
    "server": "json-server --watch db.json --port 3000"
  }
about 4 years ago · Juan Pablo Isaza Denunciar

0

It's due to the AirPlay receiver in Mac OS Monterey using port 5000. More details at this answer.

You can either disable AirPlay (System preferences --> Sharing), or start the server on another port in your package.json as mentioned:

--port 3000

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda